#!/bin/bash

# cd /data/wwwroot/pyspider
#激活环境
source py3/bin/activate

#work_path=$(cd `dirname $0`; pwd)

if [ "$1" = "webui" ]; then
    exec pyspider -c config.json webui
elif [ "$1" = "scheduler" ]; then
    exec pyspider -c config.json scheduler
elif [ "$1" = "processor" ]; then
    exec pyspider -c config.json processor
elif [ "$1" = "result-worker" ]; then
    exec pyspider -c config.json result-worker
elif [ "$1" = "fetcher" ]; then
    exec pyspider -c config.json fetcher
elif [ "$1" = "phantomjs" ]; then
    exec pyspider -c config.json phantomjs
elif [ "$1" = "all" ]; then
    exec pyspider -c config.json all
else
    echo "Pleasemake sure the positon variable in [webui scheduler processor result-worker fetcher phantomjs]."
    exit 1
fi
exit 0
